package com.feonix.support;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.servlet.http.HttpSession;

import com.feonix.complat.entity.Right;
import com.feonix.complat.entity.Role;
import com.feonix.complat.entity.User;

/**
 * 后台登录用户的bean操作类
 * 
 * @author Feonixzw
 *
 */
public class CurrentUser extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 废弃，请使用iid
	 * 
	 * @return
	 */
	private Integer iid;

	private String post;

	/**
	 * 
	 * 登录ip
	 */
	private String ip;

	/**
	 * 登录时间
	 */
	private Date accessTime;

	/**
	 * 管理机构范围
	 */
	private Integer rangeId;

	/**
	 * 管理机构名
	 */
	private String rangeName;

	/**
	 * session的id
	 */
	private String sessionId;

	/**
	 * 密码安全等级
	 */
	private Integer pwdLevel;

	private HttpSession session;

	/**
	 * 是否为系统管理员
	 */
	private boolean sysAdmin = false;

	/**
	 * 是否为机构管理员
	 */
	private boolean groupAdmin = false;

	/**
	 * 用户的角色集合
	 */
	private List<Role> roleList;

	/**
	 * 用户的权限集合
	 */
	private List<Right> rightList;

	/**
	 * 具有的权限字符串
	 */
	private Set<String> permissions = new HashSet<String>();

	public String getRangeName() {
		return rangeName;
	}

	public void setRangeName(String rangeName) {
		this.rangeName = rangeName;
	}

	public Integer getRangeId() {
		return rangeId;
	}

	public void setRangeId(Integer rangeId) {
		this.rangeId = rangeId;
	}

	public Date getAccessTime() {
		return accessTime;
	}

	public void setAccessTime(Date accessTime) {
		this.accessTime = accessTime;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public boolean isSysAdmin() {
		return sysAdmin;
	}

	public void setSysAdmin(boolean sysAdmin) {
		this.sysAdmin = sysAdmin;
	}

	public boolean isGroupAdmin() {
		return groupAdmin;
	}

	public void setGroupAdmin(boolean groupAdmin) {
		this.groupAdmin = groupAdmin;
	}

	public List<Role> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<Role> roleList) {
		this.roleList = roleList;
	}

	public List<Right> getRightList() {
		return rightList;
	}

	public void setRightList(List<Right> rightList) {
		this.rightList = rightList;
	}

	public Set<String> getPermissions() {
		return permissions;
	}

	public void setPermissions(Set<String> permissions) {
		this.permissions = permissions;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}

	public Integer getPwdLevel() {
		return pwdLevel;
	}

	public void setPwdLevel(Integer pwdLevel) {
		this.pwdLevel = pwdLevel;
	}

	public Integer getIid() {
		return iid;
	}

	public void setIid(Integer iid) {
		this.iid = iid;
	}

}
